package com.test.example.controller.ip;

import com.xingluo.tools.ip.IpAddressUtil;
import com.xingluo.tools.result.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class IpAddressController {

    @Resource
    private IpAddressUtil ipAddressUtil;

    @GetMapping("/ip")
    public String sensitive() {
        return ipAddressUtil.getAddressByIp("218.66.73.5");
    }

    @GetMapping("/ipInfo")
    public Result ipInfo() {
        return Result.success(ipAddressUtil.getIpInfo("218.66.73.5"));
    }
}
